package com.yoomiito.app.ui.my.remain.withdraw

import cn.droidlover.xdroidmvp.net.ApiException
import cn.droidlover.xdroidmvp.net.ApiSubscriber
import cn.droidlover.xdroidmvp.net.BaseModel
import cn.droidlover.xdroidmvp.net.XApi
import com.yoomiito.app.base.AppConfig
import com.yoomiito.app.base.BaseActPresenter
import com.yoomiito.app.model.BaseList
import com.yoomiito.app.model.my.ApplyInfo
import com.yoomiito.app.net.YmApi
import com.yoomiito.app.utils.NetworkUtils
import com.yoomiito.app.utils.YMToast

class WithdrawListPresenter(appConfig: AppConfig) : BaseActPresenter<WithdrawListActivity>(appConfig) {
    fun accountList(type : Int) {
        if (NetworkUtils.checkNetPermission(v)) {
            return
        }
        YmApi.getYmService()
                .accountList(type)
                .compose(v.bindToLifecycle())
                .compose(XApi.getApiTransformerData())
                .compose(XApi.getScheduler())
                .subscribe(object : ApiSubscriber<List<ApplyInfo>>() {
                    override fun onSuccess(bean: List<ApplyInfo>) {
                        v.setData(bean)
                    }
                    override fun onFail(error: ApiException) {

                    }
                })

    }


}
